package com.example.adapter;

import java.util.List;

import com.example.privatecontacts.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class PrivateContactAdapter extends BaseAdapter {
	private Context context;
	private int resourceID;
	private List<PrivateContactAdapter> listData;

	public PrivateContactAdapter(Context context, int resourceItem, List<PrivateContactAdapter> listData) {
		this.context = context;
		resourceID = resourceItem;
		this.listData = listData;
	}

	public int getCount() {
		return listData.size();
	}

	public Object getItem(int position) {
		return listData.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			LayoutInflater inflater = LayoutInflater.from(context);
			convertView = inflater.inflate(R.layout.private_listview_item, parent, false);
			ViewHolder holder = new ViewHolder();
			holder.contactName = (TextView) convertView.findViewById(R.id.private_contact_name);
			holder.contactNumber = (TextView) convertView.findViewById(R.id.private_contact_number);
			holder.selectImageView = (ImageView) convertView.findViewById(R.id.private_contact_select_image);
			convertView.setTag(holder);
		}
		
		return null;
	}

	private class ViewHolder
	{
		TextView contactName;
		TextView contactNumber;
		ImageView selectImageView;
	}
}